<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@ taglib prefix="c" 	 uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt"	 uri="http://java.sun.com/jsp/jstl/fmt"%>

<%@include file="/jsp/backoffice/include/header.jsp" %>

	<div class="panelblock">
		<h2><bean:message bundle="backoffice" key="page.list.post.title"/></h2>
			<div class="results">
				<table class="filelist">
					<tr class="clickable_headers">
						<th style="width:50px">&nbsp;</th>
						<th><bean:message bundle="backoffice" key="page.list.post.table.title" /></th>
						<th><bean:message bundle="backoffice" key="page.list.post.table.category" /></th>
						<th><bean:message bundle="backoffice" key="page.list.post.table.date.created" /></th>
						<th><bean:message bundle="backoffice" key="page.list.post.table.date.published" /></th>
					</tr>
					<c:set var="style" value="even"/>
					<c:forEach items="${posts}" var="p">
						<tr class="${style} lastline">
							<td class="center"><a href="/backoffice/editPost.do?id=${p.id}"><c:out value="${p.id}"/></a></td>
							<td><a href="/backoffice/editPost.do?id=${p.id}"><c:out value="${p.title}"/></a></td>
							<td>${p.category.name}</td>
							<td class="center"><fmt:formatDate value="${p.dateCreated}" pattern="dd/MM/yyyy HH:mm" /></td>
							<td class="center"><fmt:formatDate value="${p.datePublished}" pattern="dd/MM/yyyy HH:mm" /></td>
						</tr>
						<c:choose><c:when test="${style =='even'}"><c:set var="style" value="odd"/></c:when><c:otherwise><c:set var="style" value="even"/></c:otherwise></c:choose>
					</c:forEach>
				</table>
				<div class="results_nav"></div>
			</div>
	</div>

<%@include file="/jsp/backoffice/include/footer.jsp" %>